Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves: display-dependency-updates only shows updates from the most major allowed segment #966

Conversation

jarmoniuk
Copy link
Contributor

@jarmoniuk jarmoniuk commented May 27, 2023

Changed the way display-dependency-updates checks for updates. It turns out that other plugins did not use the same method, so they are safe. plugin- and parent-updates don't even offer these "allow-" parameters.

DisplayDependencyUpdates used the same routine that dependency reports did, but that routine only selected updates within a given segment – that's why I've split the functions in the API between restrictionForUnchangedSegment, restrictionForSelectedSegment, and restrictionForIgnoreScope. Perhaps there's a way to unite those, but that's for a future release.

Also, I've discovered another bug, but with less significance because it only affects version ranges.

If an artifact is defined using two or more ranges, and the selected version falls in the first range, the versions in between the ranges will never get selected.

[, 1.0.0]   v1=1.1.0   v2=1.1.1   v3=1.9.0  (2.0.0, 10.0.0)

from the above, v1, v2, v3 will never get shown as possible updates.

This is caused by the way that we constructed the lower limit for dependency updates: we always simply took the highest possible lower bound over all version ranges thus excluding all versions that would be in between. I think that was introduced back in the day by @sultan to fix reported versions.

That is fixed for display-dependency-updates. Not sure about the other mojo' – basically reports as they still use ArtifactVersionDetails::getHighestLowerBound – but I did not want to touch that so that I don't introduce any more regressions that I possibly can.

Overall it's a big mess and badly needs rearchitecting — but that's not something for this while.

@slawekjaranowski please check

@jarmoniuk jarmoniuk force-pushed the issue-960-allow-parameters-only-select-one-segment branch 10 times, most recently from 586c39c to 33c65fc Compare May 27, 2023 09:52
@jarmoniuk
Copy link
Contributor Author

also updated the copyright in modified files

@jarmoniuk jarmoniuk changed the title Resolves: display-dependency-managment only shows updates from the most major allowed segment Resolves: display-dependency-updates only shows updates from the most major allowed segment May 28, 2023
@slawekjaranowski
Copy link
Member

also updated the copyright in modified files

We should not change license header in existing files ... theoretically we should dig in history and confirm with authors of each file

@jarmoniuk jarmoniuk force-pushed the issue-960-allow-parameters-only-select-one-segment branch from 33c65fc to c9d9246 Compare May 31, 2023 04:01
…s from lesser segments

Resolves mojohaus#299: allowAnyUpdates should be ignored with a warning message if any of: allowMajorUpdates, allowMinorUpdates, allowIncrementalUpdates is set to false
@jarmoniuk jarmoniuk force-pushed the issue-960-allow-parameters-only-select-one-segment branch from c9d9246 to 693fe11 Compare May 31, 2023 04:08
@jarmoniuk
Copy link
Contributor Author

also updated the copyright in modified files

We should not change license header in existing files ... theoretically we should dig in history and confirm with authors of each file

Reverted those

@jarmoniuk jarmoniuk mentioned this pull request May 31, 2023
@slawekjaranowski slawekjaranowski added this to the 2.16.0 milestone Jun 1, 2023
@slawekjaranowski slawekjaranowski merged commit 9b44a44 into mojohaus:master Jun 1, 2023
@jarmoniuk jarmoniuk deleted the issue-960-allow-parameters-only-select-one-segment branch June 2, 2023 05:17
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Jun 18, 2023
### What changes were proposed in this pull request?
The pr aims to update some maven plugins to newest version. include:
- versions-maven-plugin from 2.15.0 to 2.16.0
- maven-source-plugin from 3.2.1 to 3.3.0
- maven-surefire-plugin from 3.1.0 to 3.1.2
- maven-dependency-plugin from 3.5.0 to 3.6.0

### Why are the changes needed?
- versions-maven-plugin
1.Release Notes: https://github.com/mojohaus/versions/releases/tag/2.16.0
2.Bug Fix:
Resolves: display-dependency-updates only shows updates from the most major allowed segment (mojohaus/versions#966) ajarmoniuk
Resolves mojohaus/versions#931: Fixing problems with encoding in UseDepVersion and PomHelper (mojohaus/versions#932) ajarmoniuk
Resolves mojohaus/versions#916: Partially reverted mojohaus/versions#799. (mojohaus/versions#924) ajarmoniuk
Resolves mojohaus/versions#954: Excluded plexus-container-default (mojohaus/versions#955) ajarmoniuk
Resolves mojohaus/versions#951: DefaultArtifactVersion::getVersion can be null (mojohaus/versions#952) ajarmoniuk
BoundArtifactVersion.toString() to work with NumericVersionComparator (mojohaus/versions#930) ajarmoniuk
Issue mojohaus/versions#925: Protect against an NPE if a dependency version is defined in dependencyManagement (mojohaus/versions#926) ajarmoniuk

- maven-source-plugin
v3.2.1 VS v3.3.0: apache/maven-source-plugin@maven-source-plugin-3.2.1...maven-source-plugin-3.3.0

- maven-surefire-plugin
Release Notes: https://github.com/apache/maven-surefire/releases/tag/surefire-3.1.2

- maven-dependency-plugin
v3.5.0 VS v3.6.0: apache/maven-dependency-plugin@maven-dependency-plugin-3.5.0...maven-dependency-plugin-3.6.0

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

Closes #41641 from panbingkun/SPARK-44085.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
czxm pushed a commit to czxm/spark that referenced this pull request Jun 19, 2023
### What changes were proposed in this pull request?
The pr aims to update some maven plugins to newest version. include:
- versions-maven-plugin from 2.15.0 to 2.16.0
- maven-source-plugin from 3.2.1 to 3.3.0
- maven-surefire-plugin from 3.1.0 to 3.1.2
- maven-dependency-plugin from 3.5.0 to 3.6.0

### Why are the changes needed?
- versions-maven-plugin
1.Release Notes: https://github.com/mojohaus/versions/releases/tag/2.16.0
2.Bug Fix:
Resolves: display-dependency-updates only shows updates from the most major allowed segment (mojohaus/versions#966) ajarmoniuk
Resolves mojohaus/versions#931: Fixing problems with encoding in UseDepVersion and PomHelper (mojohaus/versions#932) ajarmoniuk
Resolves mojohaus/versions#916: Partially reverted mojohaus/versions#799. (mojohaus/versions#924) ajarmoniuk
Resolves mojohaus/versions#954: Excluded plexus-container-default (mojohaus/versions#955) ajarmoniuk
Resolves mojohaus/versions#951: DefaultArtifactVersion::getVersion can be null (mojohaus/versions#952) ajarmoniuk
BoundArtifactVersion.toString() to work with NumericVersionComparator (mojohaus/versions#930) ajarmoniuk
Issue mojohaus/versions#925: Protect against an NPE if a dependency version is defined in dependencyManagement (mojohaus/versions#926) ajarmoniuk

- maven-source-plugin
v3.2.1 VS v3.3.0: apache/maven-source-plugin@maven-source-plugin-3.2.1...maven-source-plugin-3.3.0

- maven-surefire-plugin
Release Notes: https://github.com/apache/maven-surefire/releases/tag/surefire-3.1.2

- maven-dependency-plugin
v3.5.0 VS v3.6.0: apache/maven-dependency-plugin@maven-dependency-plugin-3.5.0...maven-dependency-plugin-3.6.0

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

Closes apache#41641 from panbingkun/SPARK-44085.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

display-dependency-updates only showing updates from the most major allowed segment?
2 participants